package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.config.mall.ConfigExpressVO;
import com.cskaoyan.bean.config.mall.ConfigMallVO;
import com.cskaoyan.bean.config.mall.ConfigOrderVO;
import com.cskaoyan.bean.config.mall.ConfigWxVO;
import com.cskaoyan.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author chenai
 * @description TODO
 * @date 2022-06-07 16:50
 */
@RestController
@RequestMapping("admin/config")
public class ConfigController {

    @Autowired
    ConfigService configService;

    @RequestMapping(value = "mall",method = RequestMethod.GET)
    public BaseRespVo mall() {
        return configService.mall();
    }

    @RequestMapping(value = "mall",method = RequestMethod.POST)
    public BaseRespVo mall(@RequestBody() ConfigMallVO configMallVO) {
        return configService.mallUpdate(configMallVO);
    }

    @RequestMapping(value = "express",method = RequestMethod.GET)
    public BaseRespVo express() {
        return configService.express();
    }

    @RequestMapping(value = "express",method = RequestMethod.POST)
    public BaseRespVo express(@RequestBody() ConfigExpressVO configExpressVO) {
        return configService.expressUpdate(configExpressVO);
    }

    @RequestMapping(value = "order",method = RequestMethod.GET)
    public BaseRespVo order(){
        return configService.order();
    }

    @RequestMapping(value = "order",method = RequestMethod.POST)
    public BaseRespVo order(@RequestBody() ConfigOrderVO configOrderVO){
        return configService.orderUpdate(configOrderVO);
    }

    @RequestMapping(value = "wx",method = RequestMethod.GET)
    public BaseRespVo wx(){
        return configService.wx();
    }

    @RequestMapping(value = "wx",method = RequestMethod.POST)
    public BaseRespVo wx(@RequestBody() ConfigWxVO configWxVO){
        return configService.wxUpdate(configWxVO);
    }
}
